package com.ruoyi.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.project.domain.entity.ProjectCompany;
import com.ruoyi.project.domain.entity.ProjectFfinance;
import com.ruoyi.project.mapper.ProjectCompanyMapper;
import com.ruoyi.project.mapper.ProjectFinanceMapper;
import com.ruoyi.project.service.IProjectCompanyService;
import com.ruoyi.project.service.IProjectFinanceService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class ProjectFinanceServiceImpl extends ServiceImpl<ProjectFinanceMapper, ProjectFfinance> implements IProjectFinanceService {
    @Resource
    private ProjectFinanceMapper financeMapper;


    @Override
    @Async("taskExecutor") // 指定使用的线程池
    public Boolean syncData(List<ProjectFfinance> list) {

        return this.saveBatch(list);
    }

    @Override
    public List<ProjectFfinance> getList() {
        LambdaQueryWrapper<ProjectFfinance> wrapper = new QueryWrapper<ProjectFfinance>().lambda();
        return this.list(wrapper);
    }

    @Override
    public void deleteAll(String datas) {
        financeMapper.deleteAll(datas);
    }

}
